package com.ctshk.rpc.payment.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ctshk.rpc.payment.entity.PayRecord;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 支付记录 Mapper 接口
 * </p>
 *
 * @author hef
 * @since 2021-04-21
 */
public interface PayRecordMapper extends BaseMapper<PayRecord> {

    /**
     * 根据订单号获取数据
     * @param orderId
     * @return
     */
    @Select("SELECT * FROM `t_pay_record` WHERE order_id = #{orderId} AND is_deleted = 0 ORDER BY gmt_create DESC LIMIT 1")
    PayRecord selectByOrderId(@Param("orderId") Long orderId);
}
